package com.nbgroup.mapper;

import com.nbgroup.pojo.Contract;
import com.nbgroup.pojo.dto.ContractDTO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface ContractMapper {

    List<Contract> queryCon(ContractDTO dto);

    /**
     *添加合同
     */
    void insert(Contract contract);

    /**
     * 合同详情
     */
    @Select("select t.* ,c.price coursePrice,c.name discountType from contract t left join course c on t.course_id=c.id  where t.id =#{id};")
    Contract getInfo(String id);

    /**
     * 修改合同
     */
    void update(Contract contract);
}
